home *** CD-ROM | disk | FTP | other *** search
Text File | 1994-04-21 | 3.7 KB | 129 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWRecShp.h
- // Release Version: $ 1.0d1 $
- //
- // Creation Date: 3/28/94
- //
- // Copyright: © 1993, 1994 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWRECSHP_H
- #define FWRECSHP_H
-
- #ifndef FWSHAPE_H
- #include "FWShape.h"
- #endif
-
- #ifndef FWBNDSHP_H
- #include "FWBndShp.h"
- #endif
-
- //==============================================================================
- // •• Forward Declarations
- //==============================================================================
-
- class FW_CGraphicContext;
- class FW_CRectShapeRep;
- class FW_COvalShape;
- class FW_CRoundRectShape;
- class FW_CArcShape;
- class FW_CLineShape;
- class FW_CRegionShape;
-
- //========================================================================================
- // •• CLASS FW_CRectShape
- //========================================================================================
-
- class FW_CRectShape : public FW_CShape
- {
- //----------------------------------------------------------------------------------------
- // • Constructors
- //
- public:
- FW_CRectShape();
- FW_CRectShape(const FW_CRect& rect);
-
- FW_CRectShape(const FW_CRectShape& other);
- FW_CRectShape(FW_CRectShapeRep* rep);
-
- //----------------------------------------------------------------------------------------
- // • Operators
- //
- public:
- FW_CRectShape& operator=(const FW_CRectShape& other);
- FW_CRectShape& operator=(FW_CRectShapeRep* other);
-
- FW_CRectShapeRep* operator->() const
- {return (FW_CRectShapeRep*)GetRep();}
-
- //----------------------------------------------------------------------------------------
- // • Conversion
- //
- public:
- operator FW_COvalShape() const;
- operator FW_CRoundRectShape() const;
- operator FW_CArcShape() const;
- operator FW_CLineShape() const;
- operator FW_CRegionShape() const;
-
- //----------------------------------------------------------------------------------------
- // • static Methods
- //
- public:
- static void DrawRect(FW_CGraphicContext* graphicContext, const FW_CRect& rect);
-
- };
-
- //==============================================================================
- // •• class FW_CRectShapeRep
- //==============================================================================
-
- class FW_CRectShapeRep : public FW_CBoundedShapeRep
- {
- friend class FW_CRectShape;
-
- //------------------------------------------------------------------------------
- // • Constructors/Destructors
- //
- protected:
- FW_CRectShapeRep();
- FW_CRectShapeRep(const FW_CRect& rect);
-
- virtual ~FW_CRectShapeRep();
-
- //------------------------------------------------------------------------------
- // • Inherited API
- //
- public:
- // ----- Hit Testing -----
- virtual FW_HitTestPart HitTest(const FW_CPoint& test) const;
-
- // ----- Rendering -----
- virtual void Draw(FW_CGraphicContext* graphicContext);
- static void DrawRect(FW_CGraphicContext* graphicContext, const FW_CRect& rect);
-
- // ----- Default shape -----
- virtual void SetAsDefault() const;
-
- //------------------------------------------------------------------------------
- // • New API
- //
- public:
- FW_CRectShape Copy() const;
- };
-
- //==============================================================================
- // •• Inlines
- //==============================================================================
-
- //------------------------------------------------------------------------------
- // • FW_CRectShape::DrawRect
- //------------------------------------------------------------------------------
- inline static void FW_CRectShape::DrawRect(FW_CGraphicContext* graphicContext, const FW_CRect& rect)
- {
- FW_CRectShapeRep::DrawRect(graphicContext, rect);
- }
-
- #endif